﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LardonPokerSimulator.Model.Deck
{
    public class Card : IComparable<Card>
    {
        private short _number = 0;
        private Suit _suit;
        private bool _isUsed = false;

        public Card(short aNumber, Suit aSuit)
        {
            this._number = aNumber;
            this._suit = aSuit;
        }

        public short Number
        {
            get
            {
                return this._number;
            }
        }

        public String Suit
        {
            get
            {
                return this._suit.ToString();
            }
        }

        public bool IsUsed
        {
            get
            {
                return this._isUsed;
            }
            set
            {
                this._isUsed = value;
            }
        }

        public override string ToString()
        {
            return String.Format("{0} | {1}", this._suit.ToString(), this._number);
        }

        public int CompareTo(Card aOtherObj)
        {
            if (this._suit < aOtherObj._suit)
            {
                return -1;
            }
            else if (this._suit > aOtherObj._suit)
            {
                return 1;
            }
            else
            {
                return this._number.CompareTo(aOtherObj._number);
            }
        }
    }
}
